package com.yuxin.wx.dao;

import com.yuxin.wx.domain.EsBlog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * Blog 存储库.
 *
 * @author zcq
 */
public interface EsBlogRepository extends ElasticsearchRepository<EsBlog, String> {

	/**
	 * 分页模糊查询(去重)
	 *
	 * @param title
	 * @param content
	 * @param pageable
	 * @return
	 */
	Page<EsBlog> findDistinctEsBlogByTitleContainingOrContentContaining(String title, String content, Pageable pageable);

	List<EsBlog> findDistinctEsBlogByTitleLike(String title);
}
